<?
//inculde即可以使用data数据。本页所有的data数据，倾在controller都处理好
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
?>





<?php


//传递过来的页面信息。返回的时候，会根据这些信息返回原来的页面
//统一设置一下保存图片的路径
$_uf['path'] = ROOT_PATH_ . "/uploadfiles/";

//上传icon
if (is_uploaded_file($_FILES['photo']['tmp_name'])) {
    $_uf['upfile']       = $_FILES['photo'];
    $_info               = upload_file($_uf);
    $_REQUEST['ai_photo'] = $_info['name'];
    $icon                = $_REQUEST['ai_photo'];
}

$nowpageid      = addslashes($_REQUEST['nowpageid']);
$sortby         = addslashes($_REQUEST['sortby']);
$term_nid       = addslashes($_REQUEST['term_nid']);



$_REQUEST['ai_password']      = md5(addslashes($_REQUEST['ai_password']));


$maxmen=select_one_line_all_items($table_Prefix."employee","mid != 'admin' order by mid desc");



//默认工号为年份后两位+月份两位+日期两位+随机数两位
$_REQUEST['ai_mid']=date("y") . date("m") . date("d") . rand(10,99);






// print_r2($_REQUEST);
// exit;
//设置需要搜索的表格的前缀后缀
$table = $table_Prefix . "employee";
//设置需要搜索的表格的前缀后缀

if (empty($_REQUEST['ai_applydate'])) {
    $_REQUEST['ai_applydate'] = '1970-01-01'; 
}

if (empty($_REQUEST['ai_leavedate'])) {
    $_REQUEST['ai_leavedate'] = '1970-01-01';
}

$sql=insert_date($table,$_REQUEST);

$query = mysql_query($sql) or die (mysql_error().$sql);

mysql_close($con);


?>




<script type="text/javascript">
    alert("输入信息已保存，点击确认返回继续操作.");
    document.location.href = "detail-list.php?sys_part=employee";
</script>
